using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICStockBillEntryMap : EntityTypeConfiguration<ICStockBillEntry>
    {
        public ICStockBillEntryMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FInterID, t.FEntryID });

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FInterID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FEntryID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FBatchNo)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.FNote)
                .HasMaxLength(255);

            this.Property(t => t.FSCBillNo)
                .HasMaxLength(30);

            this.Property(t => t.FMapNumber)
                .IsRequired()
                .HasMaxLength(80);

            this.Property(t => t.FMapName)
                .HasMaxLength(256);

            this.Property(t => t.FSourceBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FContractBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FICMOBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FOrderBillNo)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FDetailID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.FMTONo)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FEntrySelfB0448)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfB0165)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfB0158)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfB0161)
                .HasMaxLength(255);

            this.Property(t => t.FEntrySelfA0155)
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("ICStockBillEntry");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FQtyMust).HasColumnName("FQtyMust");
            this.Property(t => t.FQty).HasColumnName("FQty");
            this.Property(t => t.FPrice).HasColumnName("FPrice");
            this.Property(t => t.FBatchNo).HasColumnName("FBatchNo");
            this.Property(t => t.FAmount).HasColumnName("FAmount");
            this.Property(t => t.FNote).HasColumnName("FNote");
            this.Property(t => t.FSCBillInterID).HasColumnName("FSCBillInterID");
            this.Property(t => t.FSCBillNo).HasColumnName("FSCBillNo");
            this.Property(t => t.FUnitID).HasColumnName("FUnitID");
            this.Property(t => t.FAuxPrice).HasColumnName("FAuxPrice");
            this.Property(t => t.FAuxQty).HasColumnName("FAuxQty");
            this.Property(t => t.FAuxQtyMust).HasColumnName("FAuxQtyMust");
            this.Property(t => t.FQtyActual).HasColumnName("FQtyActual");
            this.Property(t => t.FAuxQtyActual).HasColumnName("FAuxQtyActual");
            this.Property(t => t.FPlanPrice).HasColumnName("FPlanPrice");
            this.Property(t => t.FAuxPlanPrice).HasColumnName("FAuxPlanPrice");
            this.Property(t => t.FSourceEntryID).HasColumnName("FSourceEntryID");
            this.Property(t => t.FCommitQty).HasColumnName("FCommitQty");
            this.Property(t => t.FAuxCommitQty).HasColumnName("FAuxCommitQty");
            this.Property(t => t.FKFDate).HasColumnName("FKFDate");
            this.Property(t => t.FKFPeriod).HasColumnName("FKFPeriod");
            this.Property(t => t.FDCSPID).HasColumnName("FDCSPID");
            this.Property(t => t.FSCSPID).HasColumnName("FSCSPID");
            this.Property(t => t.FConsignPrice).HasColumnName("FConsignPrice");
            this.Property(t => t.FConsignAmount).HasColumnName("FConsignAmount");
            this.Property(t => t.FProcessCost).HasColumnName("FProcessCost");
            this.Property(t => t.FMaterialCost).HasColumnName("FMaterialCost");
            this.Property(t => t.FTaxAmount).HasColumnName("FTaxAmount");
            this.Property(t => t.FMapNumber).HasColumnName("FMapNumber");
            this.Property(t => t.FMapName).HasColumnName("FMapName");
            this.Property(t => t.FOrgBillEntryID).HasColumnName("FOrgBillEntryID");
            this.Property(t => t.FOperID).HasColumnName("FOperID");
            this.Property(t => t.FPlanAmount).HasColumnName("FPlanAmount");
            this.Property(t => t.FProcessPrice).HasColumnName("FProcessPrice");
            this.Property(t => t.FTaxRate).HasColumnName("FTaxRate");
            this.Property(t => t.FSnListID).HasColumnName("FSnListID");
            this.Property(t => t.FAmtRef).HasColumnName("FAmtRef");
            this.Property(t => t.FAuxPropID).HasColumnName("FAuxPropID");
            this.Property(t => t.FCost).HasColumnName("FCost");
            this.Property(t => t.FPriceRef).HasColumnName("FPriceRef");
            this.Property(t => t.FAuxPriceRef).HasColumnName("FAuxPriceRef");
            this.Property(t => t.FFetchDate).HasColumnName("FFetchDate");
            this.Property(t => t.FQtyInvoice).HasColumnName("FQtyInvoice");
            this.Property(t => t.FQtyInvoiceBase).HasColumnName("FQtyInvoiceBase");
            this.Property(t => t.FUnitCost).HasColumnName("FUnitCost");
            this.Property(t => t.FSecCoefficient).HasColumnName("FSecCoefficient");
            this.Property(t => t.FSecQty).HasColumnName("FSecQty");
            this.Property(t => t.FSecCommitQty).HasColumnName("FSecCommitQty");
            this.Property(t => t.FSourceTranType).HasColumnName("FSourceTranType");
            this.Property(t => t.FSourceInterId).HasColumnName("FSourceInterId");
            this.Property(t => t.FSourceBillNo).HasColumnName("FSourceBillNo");
            this.Property(t => t.FContractInterID).HasColumnName("FContractInterID");
            this.Property(t => t.FContractEntryID).HasColumnName("FContractEntryID");
            this.Property(t => t.FContractBillNo).HasColumnName("FContractBillNo");
            this.Property(t => t.FICMOBillNo).HasColumnName("FICMOBillNo");
            this.Property(t => t.FICMOInterID).HasColumnName("FICMOInterID");
            this.Property(t => t.FPPBomEntryID).HasColumnName("FPPBomEntryID");
            this.Property(t => t.FOrderInterID).HasColumnName("FOrderInterID");
            this.Property(t => t.FOrderEntryID).HasColumnName("FOrderEntryID");
            this.Property(t => t.FOrderBillNo).HasColumnName("FOrderBillNo");
            this.Property(t => t.FAllHookQTY).HasColumnName("FAllHookQTY");
            this.Property(t => t.FAllHookAmount).HasColumnName("FAllHookAmount");
            this.Property(t => t.FCurrentHookQTY).HasColumnName("FCurrentHookQTY");
            this.Property(t => t.FCurrentHookAmount).HasColumnName("FCurrentHookAmount");
            this.Property(t => t.FStdAllHookAmount).HasColumnName("FStdAllHookAmount");
            this.Property(t => t.FStdCurrentHookAmount).HasColumnName("FStdCurrentHookAmount");
            this.Property(t => t.FSCStockID).HasColumnName("FSCStockID");
            this.Property(t => t.FDCStockID).HasColumnName("FDCStockID");
            this.Property(t => t.FPeriodDate).HasColumnName("FPeriodDate");
            this.Property(t => t.FCostObjGroupID).HasColumnName("FCostObjGroupID");
            this.Property(t => t.FCostOBJID).HasColumnName("FCostOBJID");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FMaterialCostPrice).HasColumnName("FMaterialCostPrice");
            this.Property(t => t.FReProduceType).HasColumnName("FReProduceType");
            this.Property(t => t.FBomInterID).HasColumnName("FBomInterID");
            this.Property(t => t.FDiscountRate).HasColumnName("FDiscountRate");
            this.Property(t => t.FDiscountAmount).HasColumnName("FDiscountAmount");
            this.Property(t => t.FSepcialSaleId).HasColumnName("FSepcialSaleId");
            this.Property(t => t.FOutCommitQty).HasColumnName("FOutCommitQty");
            this.Property(t => t.FOutSecCommitQty).HasColumnName("FOutSecCommitQty");
            this.Property(t => t.FDBCommitQty).HasColumnName("FDBCommitQty");
            this.Property(t => t.FDBSecCommitQty).HasColumnName("FDBSecCommitQty");
            this.Property(t => t.FAuxQtyInvoice).HasColumnName("FAuxQtyInvoice");
            this.Property(t => t.FOperSN).HasColumnName("FOperSN");
            this.Property(t => t.FCheckStatus).HasColumnName("FCheckStatus");
            this.Property(t => t.FSplitSecQty).HasColumnName("FSplitSecQty");
            this.Property(t => t.FInStockID).HasColumnName("FInStockID");
            this.Property(t => t.FSaleCommitQty).HasColumnName("FSaleCommitQty");
            this.Property(t => t.FSaleSecCommitQty).HasColumnName("FSaleSecCommitQty");
            this.Property(t => t.FSaleAuxCommitQty).HasColumnName("FSaleAuxCommitQty");
            this.Property(t => t.FSelectedProcID).HasColumnName("FSelectedProcID");
            this.Property(t => t.FVWInStockQty).HasColumnName("FVWInStockQty");
            this.Property(t => t.FAuxVWInStockQty).HasColumnName("FAuxVWInStockQty");
            this.Property(t => t.FSecVWInStockQty).HasColumnName("FSecVWInStockQty");
            this.Property(t => t.FSecInvoiceQty).HasColumnName("FSecInvoiceQty");
            this.Property(t => t.FCostCenterID).HasColumnName("FCostCenterID");
            this.Property(t => t.FPlanMode).HasColumnName("FPlanMode");
            this.Property(t => t.FMTONo).HasColumnName("FMTONo");
            this.Property(t => t.FEntrySelfB0447).HasColumnName("FEntrySelfB0447");
            this.Property(t => t.FEntrySelfB0448).HasColumnName("FEntrySelfB0448");
            this.Property(t => t.FRowClosed).HasColumnName("FRowClosed");
            this.Property(t => t.FEntrySelfA0240).HasColumnName("FEntrySelfA0240");
            this.Property(t => t.FEntrySelfD0147).HasColumnName("FEntrySelfD0147");
            this.Property(t => t.FEntrySelfD0149).HasColumnName("FEntrySelfD0149");
            this.Property(t => t.FSecQtyActual).HasColumnName("FSecQtyActual");
            this.Property(t => t.FSecQtyMust).HasColumnName("FSecQtyMust");
            this.Property(t => t.FEntrySelfB0165).HasColumnName("FEntrySelfB0165");
            this.Property(t => t.FEntrySelfB0158).HasColumnName("FEntrySelfB0158");
            this.Property(t => t.FEntrySelfB0159).HasColumnName("FEntrySelfB0159");
            this.Property(t => t.FEntrySelfB0166).HasColumnName("FEntrySelfB0166");
            this.Property(t => t.FEntrySelfB0161).HasColumnName("FEntrySelfB0161");
            this.Property(t => t.FEntrySelfB0167).HasColumnName("FEntrySelfB0167");
            this.Property(t => t.FEntrySelfA0155).HasColumnName("FEntrySelfA0155");
            this.Property(t => t.FEntrySelfA0156).HasColumnName("FEntrySelfA0156");
            this.Property(t => t.FEntrySelfA0157).HasColumnName("FEntrySelfA0157");
        }
    }
}
